package com.dmall.ssm.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dmall.ssm.pojo.User;
import com.dmall.ssm.service.TestRedisService;
import com.dmall.ssm.service.UserService;

@Controller
@RequestMapping("/test/redis")
public class TestRedisController {

	//@Autowired
	private TestRedisService redisService;
	
	//@Autowired
	private UserService userService;
	
	
	@RequestMapping("/testtx")
	public void testTx() {
		redisService.testTx();
	}
	
	@RequestMapping("/tx")
	@ResponseBody
	public String tx() {
		User user = userService.findById(1);
		user.setRealName("张三三");
		redisService.execute(user);
		return "success";
	}
}
